/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Semaforos;
import java.util.concurrent.Semaphore;
/**
 *
 * @author 21322325
 */
public class Semaforo {
    
    public static Semaphore semaforo;
    
    public static void main (String [] args){
        
        semaforo = new Semaphore(1);
        
        Hilo h1 = new Hilo ("Perro",semaforo);
        Hilo h2 = new Hilo ("Gato",semaforo);
        Hilo h3 = new Hilo ("Canario",semaforo);
        Hilo h4 = new Hilo ("Delfín",semaforo);
        Hilo h5 = new Hilo ("Mosquito",semaforo);
        
        h1.start();
        h2.start();
        h3.start();
        h4.start();
        h5.start();
    }
}
